import request from '@/utils/request'

// 表单重置
export function resetForm(refName) {
  if (this.$refs[refName]) {
    this.$refs[refName].resetFields();
  }
}

// 新增场地
export function addSite(params) {
  return request({
    url: '/bus/site/add',
    method: 'post',
    data: params
  })
}

// 修改场地
export function updateSite(params) {
  return request({
    url: '/bus/site/update',
    method: 'post',
    data: params
  })
}

// 删除场地
export function deleteSite(ids) {
  return request({
    url: '/bus/site/delete?ids=' + ids,
    method: 'get'
  })
}

// 查看场地
export function getByIdSite(id) {
  return request({
    url: '/bus/site/getById?id=' + id,
    method: 'get'
  })
}


// 获取场地列表
export function getSitedata(data) {
  return request({
    url: '/bus/site/listdata?name=' + data.name + '&pageNum=' + data.pageNum + '&pageSize=' + data.pageSize + '&orgName=' + data.orgName + '&status=' + data.status,
    method: 'get'
  })
}


// 会议室新增
export function addMroom(params) {
  return request({
    url: '/bus/meetingRoom/insert',
    method: 'post',
    data: params
  })
}

// 删除会议室
export function deleteMroom(ids) {
  return request({
    url: '/bus/meetingRoom/delete?ids=' + ids,
    method: 'get'
  })
}

// 查看会议室
export function getByIdMroon(id) {
  return request({
    url: '/bus/meetingRoom/getById?id=' + id,
    method: 'get'
  })
}

// 修改会议室
export function updateMroom(params) {
  return request({
    url: '/bus/meetingRoom/update',
    method: 'post',
    data: params
  })
}



// 获取会议室列表
export function getMroom(data) {
  return request({
    url: '/bus/meetingRoom/listdata?meetName=' + data.meetName + '&pageNum=' + data.pageNum + '&pageSize=' + data.pageSize + '&weekProperties=' + data.weekProperties + '&status=' + data.status + '&deviceProperties=' + data.deviceProperties + '&numPeople=' + data.numPeople,
    method: 'get'
  })
}

// 上传图片文件
export function upImg(file) {
  return request({
    url: '/common/uploadFtpFile',
    method: 'post',
    data: file
  })
}